package com.lykj.llw.box.adapter

import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.lib_base.component.GlideApp
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.PlayingListResponse

/**
 * ================================================
 * 正在玩游戏列表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/10/18-14:11
 */
class PlayingAdapter :
    BaseQuickAdapter<PlayingListResponse.DataDTO, BaseViewHolder>(R.layout.item_playing) {
    override fun convert(holder: BaseViewHolder, item: PlayingListResponse.DataDTO) {
        holder.setText(R.id.tv_game_name, "${item.gamename}")
        holder.setText(R.id.tv_label, "${item.gametype} ${item.collection}")

        GlideApp.with(context)
            .load(item.icon)
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(holder.getView(R.id.iv_icon))
    }
}